package ovm.gui.views.catalogs;

import ovm.gui.views.AbstractCatalogView;
import ovm.management.EntityTableFormManager;

public class DefaultIdValueCatalogView extends AbstractCatalogView {
    
    public DefaultIdValueCatalogView(Class entityClass, String caption, Boolean editable) {
        super(entityClass, editable);
        setCaption(caption);
    }

    @Override
    protected void setContainerProperties() {
        entityContainer.addContainerProperty("id", Integer.class, null, true, true);
        entityContainer.addContainerProperty("value", String.class, "", true, true);
    }

    @Override
    protected void buildTable() {
        table.setVisibleColumns(EntityTableFormManager.getDefaultCatalogTableProperties());
        table.setColumnHeaders(EntityTableFormManager.getDefaultCatalogTableCaptions());
        for (Object propertyId : entityContainer.getContainerPropertyIds()) {
            table.setColumnWidth(propertyId, 150);
        }

    }

}
